<?php
/**
 * 后盾首页控制器
 */
namespace Admin\Controller;
class IndexController extends BaseController {

    /**
     * 后台首页视图
     */
    public function index () {
        $this->display();
    }

    /**
     * 面板信息页
     */
    public function info () {
        $db = M('user');
        $this->user = $db->count();
        $db = M('weibo');
        $this->weibo = $db->where(array('isturn' => 0))->count();
        $this->turn = $db->where(array('isturn' => array('GT', 0)))->count();
        $this->comment = M('comment')->count();
        $this->display();
    }

    /**
     * 退出登录
     */
    public function logOut () {
        unset($_SESSION['userid']);
        unset($_SESSION['loginuser']);
        //重定向到登录页面
        redirect(U('Login/index', '', ''));
    }
}
?>